<?php

namespace App\Http\Controllers\Api\v1;

use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Api\BaseController;

class BaseController extends BaseController
{

     public function __construct()
    {
        //echo '000000';exit;
        parent::filter_xss();
        if(!defined('IS_ACCESS_TOKEN_CHECKED'))
        {
            parent::__construct();// 接口调用验证
        }
    }



    public function success($data, $message = 'success')
    {
        return response()->json([
            'code' => 0,
            'message' => $message,
            'data' => $data
        ]);
    }

    public function errorr($message = 'error')
    {
        return response()->json([
            'code' => -1,
            'message' => $message
        ]);
    }

    public function success_msg($message = 'success')
    {
        return response()->json([
            'code'=>0,
            'message'=>$message
        ]);
    }
}
